<?php
namespace App\Service;
use App\Models\WebsitesAdmin;
use Illuminate\Support\Facades\Auth;

class WebsitesAdminService extends CommonService
{
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * 获取登录用户的网站id
     * @return array
     */
    public static function getAdminWebsites()
    {
        //得到网站主账号id
        $masterAccountId = self::masterAccountId();
        $data = WebsitesAdmin::query()->where('admin_id', $masterAccountId)->select('website_id')->get()->toArray();
        if(!$data){
            return [];
        }
        $result = array_column($data,'website_id');
        return  $result;
    }
}

